package ar.com.equis.arquitectura.service {
	import mx.collections.ArrayList;
	import mx.collections.IList;
	import mx.logging.ILogger;
	import mx.rpc.AbstractOperation;
	import mx.rpc.AsyncToken;
	import mx.rpc.Responder;

	public class ServiceCallDelegate implements IServiceCallDelegate {
		
		public function ServiceCallDelegate() {
		}
		
		public function doInvocation(service:Service, name:String, parameters:Array):void {
			var operation:AbstractOperation = service.remoteObject.getOperation(name);
			operation.arguments = parameters;
			
			trace("Sending service request");
			var token:AsyncToken = operation.send();
			token.addResponder(new Responder(service.resultHandler, service.handleFault));
		}
	}
}